package cn.lzy.demo;

import net.sf.cglib.proxy.Enhancer;

/**
 * @Description
 * @Author lzy
 * @Date 2023/12/14 17:58
 * @Version
 *
 **/
public class TestDemo {

    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(Calculator.class);
        enhancer.setCallback(new CalculatorProxy());
        Calculator calculator = (Calculator) enhancer.create();
        System.out.println("calculator.getClass() = " + calculator.getClass());
        calculator.add(1, 1);
    }
}
